package com.luobd.db;

import java.sql.Connection;
import java.util.List;

public class Client {


    public static void main(String[] args) {

        DatabaseConfig config = new DatabaseConfig();
        config.setHost("127.0.0.1");
        config.setPort(3306);
        config.setDbName("blog");
        config.setUsername("root");
        config.setPassword("root");
        config.setDbType(DatabaseConfig.DbType.MYSQL);



        DatabaseConfig configDm = new DatabaseConfig();
        configDm.setHost("127.0.0.1");
        configDm.setPort(5236);
        configDm.setDbName("DMHR");
        configDm.setUsername("SYSDBA");
        configDm.setSchema("DMHR");
        configDm.setPassword("Luoyu666@@");
        configDm.setDbType(DatabaseConfig.DbType.DM);

        try (Connection conn = ConnectionManager.getConnection(configDm)) {
            MetadataFetcher fetcher = MetadataFetcherFactory.createFetcher(configDm, conn);
            List<Table> tables = fetcher.getTables();


            System.out.println(tables);


        } catch (Exception e) {
            e.printStackTrace();
        }






    }



}
